<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<c:url value='/insdep/easyui_full.css'/>" rel="stylesheet"
	type="text/css">
<link href="<c:url value='/insdep/icon.css'/>" rel="stylesheet" type="text/css">
<script type="text/javascript"
	src="<c:url value='/insdep/jquery-1.11.3.min.js'/>"></script>
<script type="text/javascript"
	src="<c:url value='/insdep/jquery.easyui-1.5.2.min.js'/>"></script>
<script type="text/javascript"
	src="<c:url value='/insdep/insdep-extend.min.js'/>"></script>
<title>Insert title here</title>
</head>
<body>
	<script type="text/javascript">
		/* 已发送操作 */
		function dojobmakeemail(value, row, index) {
			var remove = "", makedemaildetail = "";
			
			makedemaildetail = "<a onclick='makeddetail(" + row.emailId+ ")' class='easyui-linkbutton button-teal handle-btn'>邮件详情</a>";
			remove = "<a onclick='maked_updatestate(" + row.emailId+ ")' class='easyui-linkbutton button-darkblue handle-btn'>删除</a>";
			return makedemaildetail + remove;
		}
		/* 删除按钮方法 */
		function maked_updatestate(emailId){
			$.post('maked_updatestate',{data:emailId},function(data){
				$.messager.alert('提示', '删除成功！', 'info'); 
				$("#makedemail-list").datagrid("load");
			});	
		}
		
		/* 详情 */
		function makeddetail(emailId){
			$("#makeddetailinfo").datagrid({url: "makeddetailif?emailid=" + emailId});
			$("#makeddetailid").window("open");
		}
	</script>
	<div class="easyui-layout" fit="true" >
		<!-- 已发送 -->
		<div id="makedemail" style="width:100%;height:100%;">
	        <table id="makedemail-list" class="easyui-datagrid" style="height:100%;width:100%;"
			data-options="
				url:'to_makedemailt',
				autoRowHeight:false,
				striped:true,
				pagination:true,
				rownumbers:true,
				singleSelect:true,
				fitColumns:true,
				remoteSort:false,
				pageList:[5,10]
			">   
        	<thead>   
	            <tr>
	            	<th data-options="field:'emailId',checkbox:true"></th> 
	            	<th style="width:8%;" align="center" data-options="field:'name'">发件人</th> 
	            	<th style="width:8%;" align="center" data-options="field:'reservename'">收件人</th>
	            	<th style="width:20%;" align="center" data-options="field:'startdate'">发件时间</th>
	            	<th style="width:30%;" align="center" data-options="field:'reservestate'">收件状态</th>  
	            	<th style="width:10%;" align="center" data-options="field:'copynum'">抄送数量</th>  	  
	            	<th style="width:24%;" align="center" data-options="field:'dojob',formatter:dojobmakeemail">操作</th>                 
	            </tr>   
       		</thead>   
    		</table>
		</div>
	</div>
	
	
	<!-- 已发送详情窗口 -->
	<div id="makeddetailid" class="easyui-window" title="邮件详情" data-options="collapsible:false,minimizable:false,maximizable:false,modal:true, closed: true" style="width:400px;height:310px;padding:5px;">
        <div class="easyui-layout" data-options="fit:true">
            <table border="0" id="makeddetailinfo" class="easyui-datagrid" style="height:100%;width:100%;"   
                data-options=" fitColumns:true,singleSelect:true,
                				autoRowHeight:true,singleSelect:true
                " >   
                <thead>   
                    <tr style="border:1px solid white;height:100%;width:100%;">
                    	<th data-options="field:'name'" align="center"  style="width:20%;"></th>   
                        <th data-options="field:'value'" style="width:85%;"></th>                          
                    </tr>   
                </thead>   
            </table>
                 
            <div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
                <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel', plain:true" href="javascript:void(0)" onclick="$('#makeddetailid').window('close');">关闭</a>
            </div>
        </div>
    </div>
</body>
</html>